<template>
	<div class="actives">
		<div class="fixed">
			<div class="title flex">
				<div class="title_left">
					<img @click="back" src="../assets/image/return.png"/>
				</div>
				<div class="add">
					审核报名
				</div>
				<div >
					
				</div>
			</div>

			<div class="top flex">
				
					<div v-for="(item,index) in nameoptions" v-bind:class="{active:index==isActive}" @click="checkItem(index)">{{item.titile}}</div>

				

			</div>
		</div>
		<div class="lists" v-if="tableData">

			<div class="list " v-for="(item,index) in tableData" :key="index">
				<div class="zong flex" v-if="item.link_to_status!=0">
					<div class="mes flex">
					
					<div class="left flex">
						<div class="shop_name flex">
							<img src="../assets/image/shop.png"/><span>{{item.store_name}}</span>
						</div>
						<div class="shop_detail flex">
							<div>编号：{{item.link_storeid}}</div>
						<div class="data flex">
						<img src="../assets/image/youxainqi.png"/><span>{{item.link_addtime}}</span>
						
					</div>
						</div>
						</div>
						</div>
						<div class="flex rights" v-if="item.link_to_status==2"><span>拒绝</span></div>
					    <div class="flex right" v-if="item.link_to_status==1" ><span>通过</span></div>
					
					
				
				</div>
				<div @click="wx_p_r(item.link_id)" class="zong flex" v-else>
					<div class="mes flex">
					
					<div class="left flex">
						<div class="shop_name flex">
							<img src="../assets/image/shop.png"/><span>{{item.store_name}}</span>
						</div>
						<div class="shop_detail flex">
							<div>编号：{{item.link_storeid}}</div>
						<div class="data flex">
						<img src="../assets/image/youxainqi.png"/><span>{{item.link_addtime}}</span>
						
					</div>
						</div>
						</div>
					</div>
						<div class="flex right" v-if="item.link_to_status==0" ><span>未审核</span></div>
					
				
				</div>
				
				
			</div>
		</div>
		<div class="none flex" v-else>
			空空如也~
		</div>
	</div>
	</div>
	</div>
</template>

<script>
	export default {
		data() {
			return {
				isActive: 0,
				show: -1,
				activeIndex: -1,
				nameoptions: [{
						titile: '全部'
					},
					{
						titile: '待审核'
					},
					{
						titile: '报名成功'
					},
					{
						titile: '拒绝'
					}
				],
				tableHeight: null,
				tableData:"",
				id:this.$route.query.id,
			}
		},
		//在模板渲染成html前调用，即通常初始化某些属性值，然后再渲染成视图
		created: function() {

		},
		methods: {
			back(){
				this.$router.go(-1)
			},

			checkItem(index) {
				this.isActive = index;
				if(index==0){
					this.list()
				}
				if(index==1){
					this.list(0)
				}
				if(index==2){
					this.list(1)
				}
				if(index==3){
					this.list(2)
				}
				
			},
			showop(index) {
				let that = this;
				if(that.show == index) {
					that.show = -1; //在这里就将它赋值为-1  由于：-1 !=  index 所以其他内容隐藏 ，被点击的则打开
				} else {
					that.show = index; //这里是把index赋值给isShow，isShow=index则显示
				}

			},
			//查看详情
			creat_c() {
				this.$router.push({
					path: '/Create_coupons'
				});
			},
			wx_p_r(link_id){
				 this.$router.push({
						path: '/wx_p_r',
						query:{
							link_id:link_id
						}
					});
			},
			 list(e){
           	var that=this;
      var qs = require('qs');
			that.$http.post(this.baseURL+"/index.php/waveguest/coupon/enroll_verify", qs.stringify({
						"id": that.id,
						"link_to_status":e,
						"key":localStorage.getItem("key")
				})).then(response => {
					
					that.tableData=response.data.data
					console.log(response)
					})
					.catch(error => {

					});
    
           }
			
		},
		mounted() {
			this.list()

		},
	}
</script>

<style>

</style>
<style scoped="scoped">
	.active {
		color: #007AFF;
	}
	
	.top {
		font-size: 0.60869rem;
		width: 100%;
		max-width: 640px;
		background: white;
		padding-bottom: 0.3rem;
		justify-content: space-around;
		
	}
	
	
	
	.mes {
		margin: 0.5rem;
		font-size: 0.8rem;
		justify-content: space-between;
		flex-direction: column;
		width: 60%;
	}
	.data{
		align-items: center;
	}
	.data>img{
		width: 0.47826rem;
		height: 0.47826rem;
		padding-right: 0.2rem;
	}
	.shop_detail>div{
		font-size: 0.5217rem;
		color: #868E91;
	}
	.title_left {
		
		width: 0.67391rem;
		height: 0.67391rem;
		
	}
	.title_left>img{
		
		width: 0.67391rem;
		height: 0.67391rem;
		
	}
	
	.lists {
		-webkit-overflow-scrolling : touch;
		position: fixed;
		bottom: 0rem;
		top: 3rem;
		background: #F5F6FA;
	
		width: 100%;
		padding: 1rem 0;
		overflow-y: scroll;
	}
	
	.list {
		/*border: 1px solid white;*/
		margin-bottom: 0.5rem;
		margin-left: 0.5rem;
		margin-right: 0.5rem;
		padding: 0.1rem 0.3rem;
		background: url(../assets/image/beijing.png) no-repeat;
		background-size: 100%;
		border-radius: 10px;
	}
	
	
	
	
	.fixed {
		position: fixed;
		top: 0;
		background: white;
		width: 100%;
		max-width: 640px;
		z-index: 99;
	}
	
	.title {
		width: 90%;
		padding:0 5% 0 5%;
		height: 2rem;
		font-size: 0.7193rem;
		background: white;
		align-items: center;
		padding-bottom: 0.3rem;
		
	}
	.title div{
		width: calc(100%/3);
		align-items: center;
	}
	.title>div:nth-child(2){
		text-align: center;
	}
	.add>img {
		width: 1rem;
		height: 1rem;
	}
	.zong{
		flex-direction: row;
		align-items: center;
		justify-content: space-between;
	}
	.left{
       flex-direction: column;
	}
	.shop_detail{
		align-items: center;
		width: 100%;
		justify-content: space-between;
		padding-top: 0.5rem;
		
	}
	.shop_name{
		font-size: 0.60869rem;
		align-items: center;
		
	}
	.shop_name>img{
		width: 0.5217rem;
		height: 0.5217rem;
		padding-right: 0.3rem;
		
	}
	.right{
		font-size: 0.5652rem;
		padding-right: 0.5rem;
		color: #007AFF;
	}
	.rights{
		font-size: 0.5652rem;
		padding-right: 0.5rem;
		color: #FF0000;
	}
	.none{
		position: fixed;
		width: 100%;
		height: 100%;
		background: #F5F6FA;
		justify-content: center;
		align-items: center;
		font-size: 0.5217rem;
	}
</style>